using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using MemberMgr.Data.BusinessObjects;
using MemberMgr.Data.Base;

namespace MemberMgr.Data.ManagerObjects
{
    public partial interface ItRightManager : IManagerBase<tRight, uint>
    {
		// Get Methods
		IList<tRight> GetByROLEID(System.UInt32 tRole);
    }

    partial class tRightManager : ManagerBase<tRight, uint>, ItRightManager
    {
		#region Constructors
		
		public tRightManager() : base()
        {
        }
        public tRightManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<tRight> GetByROLEID(System.UInt32 tRole)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(tRight));
			
			
			ICriteria tRoleCriteria = criteria.CreateCriteria("TRole");
            tRoleCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", tRole));
			
			return criteria.List<tRight>();
        }
		
		#endregion
    }
}